﻿using DotNetRepository.LinqToObjects;
using DotNetRepository.LinqToSql;

namespace DotNetRepository.UnitTests
{
    public static class Configuration
    {
        public static RepositoryType RepositoryType{ get; set;}
        
        public static IEntityRepository<T> GetRepository<T>() where T : class, IEntity
        {
            if (RepositoryType == RepositoryType.LinqToSql)
            {
                return LinqToSqlRepository<T>.Instance;
            }
            else
            {
                return LinqToObjectsRepository<T>.Instance;
            }
        }
    }

    public enum RepositoryType
    {
        LinqToObjects,
        LinqToSql
    }
}
